import { createRouter, createWebHistory } from 'vue-router';
import Dashboard from '../views/Dashboard.vue';

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard,
    meta: {
      title: 'Keep运动平台数据分析'
    }
  },
  // 其他路由...
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

// 全局前置守卫，设置页面标题
router.beforeEach((to, from, next) => {
  document.title = to.meta.title || 'Keep平台数据分析';
  next();
});

export default router; 